<!doctype html>
<title>CodeMirror: Theme Demo</title>
<meta charset="utf-8"/>
<!-- <link rel=stylesheet href="./../../statics/doc/docs.css"> -->
 <link rel="stylesheet" href="./../../statics/lib/codemirror.css">
 <link rel="stylesheet" href="./../../statics/theme/darcula.css">
 <style>
  html,
  body {
      height: 100%;
      margin: 0;
  }
  .title-wrapper,
  .code-wrapper {
      display: flex;
      align-items: center;
      justify-content: center;
  }
  h2.title {
      width: 50%;
      color: red;
      padding: 0 20px;
      font-size: 14px;
  }
  .code-wrapper {
      width: 100%;
      height: 86%;
  }
  .previewBtn {
      display: inline-block;
      padding: 5px 30px;
      background-color: red;
      color: #fff;
      text-decoration: none;
  }
  .code,
  .preview-container {
      width: 50%;
      height: 100%;
      overflow: hidden;
      border: 1px solid #ccc;
  }
  .code {
      margin-right: 10px;
  }
  /* .code textarea {
      width: 100%;
      height: 100%;
      white-space: pre;
      resize: none;
      border: none;
      outline: none;
  } */
  .preview-container .preview {
      width: 100%;
      height: 100%;
  }
  .preview-container iframe {
      display: block;
      border: none;
      outline: none;
      width: 100%;
      height: 100%;
  }
  .code-s{
    float: left;
    margin-right: 20px;
  }
 </style>

<!-- <script src="./../../statics/js/jquery.min.js" type="text/javascript"></script> -->
<script src="https://cdnjs.loli.net/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<script src="./../../statics/lib/codemirror.js"></script>
<script src="./../../statics/mode/javascript/javascript.js"></script>
<script src="./../../statics/addon/selection/active-line.js"></script>
<script src="./../../statics/addon/edit/matchbrackets.js"></script>
<script src="./../../statics/js/json/data.js"></script>
<style>
    .CodeMirror {border: 1px solid black; font-size:13px}
</style>



<div class="previewBtn" onclick="onPreview()">
  预览
</div>
<div class="code-s">
  选择
  <select id="select_code">
  </select>
</div>
<div class="title-wrapper">
    <h2 class="title">编辑代码：</h2>
    <h2 class="title">查看效果：</h2>
</div>
<div class="code-wrapper">
    <div class="code">
      <textarea id="code" class="js-code" name="code">

      </textarea>

    </div>

    <div class="preview-container">
        <div class="preview js-preview"></div>
    </div>
</div>



<script src="./../../statics/js/index.js"></script>
<script>

 